FOR EACH csta_hist WHERE csta_std_cost = 0 :
    FOR FIRST ptp_det WHERE ptp_part = csta_part AND ptp__chr01 = "C" NO-LOCK,
        FIRST sct_det WHERE sct_part = ptp_part AND sct_sim = SUBSTRING(csta_sim,3,10) + "S" AND sct_site = ptp_site NO-LOCK:
    END.

    DISP csta_sim csta_part csta_avg_cost csta_std_cost. 
    IF AVAILABLE sct_det THEN
        DISP sct_sim sct_site sct_cst_tot.
END.
